{extend name="Public/base"/}

{block name="style"}
{/block}
{block name="body"}
<div class="main-box clearfix">
	<div class="tabs-wrapper profile-tabs">
		<ul class="nav nav-tabs">
			<li {if condition="$model_id eq 1"}class="active"{/if}>
				<a href="{:U('Content/index')}">全部</a>
			</li>
			{volist name="model_list" id="item"}
			{if condition="$item['extend'] eq 1"}
			<li {if condition="$model_id eq $item['id']"}class="active"{/if}>
				<a href="{:U('Content/index',array('model_id'=>$item['id']))}">{$item['title']}</a>
			</li>
			{/if}
			{/volist}
		</ul>
		<div class="tab-content">
			<div class="tab-pane fade in active">
				<div class="clearfix m10">
					{if condition="$model_id gt 1"}
					<a href="{:U('Content/add',array('model_id'=>$model_id))}" class="btn btn-primary">新增</a>
					{/if}
					<button url="{:U('Content/del',array('model_id'=>$model_id))}" class="btn btn-danger ajax-post confirm"  target-form="ids">删除</button>
				</div>
				<div class="table-responsive clearfix">
					<table class="table table-hover">
						<thead>
							<tr>
								<th width="30"><input class="checkbox check-all" type="checkbox"></th>
								{volist name="grid['grids']" id="item"}
								<th>{$item['title']}</th>
								{/volist}
								<th>操作</th>
							</tr>
						</thead>
						{if condition="empty($list)"}
						<tr>
							<td></td>
							<td>暂无数据！</td>
						</tr>
						{else/}
						<tbody>
							{volist name="list" id="item"}
							<tr>
								<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}"></td>
								{volist name="grid['grids']" id="vo"}
								{if condition="$vo['format']"}
								<td>{$item[$vo['field'][0]]|$vo['format']}</td>
								{else/}
								<td>{$item[$vo['field'][0]]}</td>
								{/if}
								{/volist}
								<td>
									{if condition="$item['status'] eq '1'"}
									<a href="{:U('Content/setstatus',array('id'=>$item['id'],'model_id'=>$model_id,'status'=>'2'))}" class="ajax-get">取消审核</a>
									{else/}
									<a href="{:U('Content/setstatus',array('id'=>$item['id'],'model_id'=>$model_id,'status'=>'1'))}" class="ajax-get">审核</a>
									{/if}
									{if condition="$model_id gt 1"}
									<a href="{:U('Content/edit',array('id'=>$item['id'],'model_id'=>$model_id))}" >编辑</a>
									{/if}
									<a href="{:U('Content/del',array('id'=>$item['id'],'model_id'=>$model_id))}" class="ajax-get confirm">删除</a>
								</td>
							</tr>
							{/volist}
						</tbody>
						{/if}
					</table>
				</div>
				{$page}
			</div>
		</div>
	</div>
</div>
{/block}
{block name="script"}
{/block}